/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package json;

/**
 *
 * @author Alexx
 */

import engine.Singleton;
import java.io.IOException;
import org.json.simple.parser.ParseException;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
import server.ConnectClient;
import server.MultiThreadedServer;
import server.ServeOneThread;
import server.Server;

/**
 *
 * @author Alexx
 */
public class MockStart {
  private static ServeOneThread ser;
  private static MockClient cli, cli2;
  
 @BeforeClass
    public static void initiate() throws IOException {
//      MultiThreadedServer s = new MultiThreadedServer();
//      s.start();
      cli = new MockClient();
      cli2 = new MockClient();
    }
 
  @Test
  public void testAutorization() throws IOException 
  {
    String send = "{\"Type\":\"Auth\", \"Name\":\"Test\"}";
    cli.sendUser(send);
//    System.out.println(Res.set());
//    Assert.assertEquals(Res.set(), "{\"Type\":\"Users\", \"Name\":\"Test\"}");
  }
  
    @Test
  public void testAutorization2() throws IOException 
  {
    String send = "{\"Type\":\"Auth\", \"Name\":\"Test2\"}";
    cli.sendUser(send);
  }
    
    
       @Test
  public void testOffer() throws IOException 
  {
    String send = "{\"Type\":\"SetPartner\", \"Name\":\"Test2\", \"OfferName\":\"Test\"}";
    cli.sendUser(send);
  }
       
  @Test
  public void testStart() throws IOException 
  {
    String send = "{\"Type\":\"StartGame\", \"YouLogin\":\"Test2\", \"PartnerLogin\":\"Test\"}";
    cli.sendUser(send);
  }
    
    


}
